<%-- 
    Document   : Customers
    Created on : Nov 1, 2011, 11:42:11 PM
    Author     : Mr-aUgust
--%>

<%@page pageEncoding="UTF-8"%>
<%@ page session="true" import="java.util.Collection, DAL.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/taglib139.tld" prefix="pg" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>East2West Tours and Travels</title>
        <style type="text/css">
            #Table
            {
            border:1px solid green;
            }
            th
            {
             border:1px solid green;
            background-color:green;
            color:white;
            }
            .td
            {
             border:1px solid green;
            }
            .font
            {
                font-family:"Times New Roman", Times, serif;
                font-size:x-large;
                font-weight:bold;
                width:200px;
                margin-left:auto;
                margin-right:auto;
                color:#0707e7;
            }
        </style>
    </head>
    <body>
    <%
        session.removeAttribute("status");
        session.removeAttribute("statusH");
        
        CustomerBean cus=new CustomerBean();
        Collection coll=cus.SelectCustomers();
        request.setAttribute("customer",coll);
    %>
       
    <div class="font">List Of Customers</div>    
    <table width="100%" id="Table">  
        <tr>
            <th>UserName</th>
            <th>FullName</th>
            <th>Gender</th>
            <th>Email</th>
            <th>Coutry</th>
            <th>Address</th>
            <th>Phone</th>
            <th>Delete</th>
        </tr>
        <pg:paging pageSize="5" url="management.jsp?page=Customers"  >
        <c:forEach items="${customer}" var="c">
            <pg:item>
        <tr>
            <td class="td">${c.userName}</td>
            <td class="td">${c.fullName}</td>
            <td class="td">${c.gender}</td>
            <td class="td">${c.email}</td>
            <td class="td">${c.country}</td>
            <td class="td">${c.address}</td>
            <td class="td">${c.phone}</td>
            <td class="td">
                <form action="../ControllerCustomer" method="post">
                    <input type="hidden" name="username" value="${c.userName}" />
                    <input type="submit" name="delete" value="Delete" OnClick="return confirm('Are you sure you want delete record this?');"/>
                </form>
            </td>
        </tr>
    </pg:item>       
    </c:forEach>
        <pg:index>
          <pg:page><%=thisPage%></pg:page>
        </pg:index>
    </pg:paging>
    </table>
    </body>
</html>
